﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace EWDTAssignment
{
    public partial class AdvanceSearch : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                List<string> list = App_Code.DBManager.getCategory();
                ddlistcategory.DataSource = list;
                ddlistcategory.DataBind();
            }
        }
        protected void btnSearch_OnClick(object sender, EventArgs e)
        {
            string txtproductName = txtbxProductName.Text.ToString().Trim();
            string listcategory = ddlistcategory.Text.ToString().Trim();
            decimal listprice = decimal.Parse(ddlistPrice.Text.ToString().Trim());
            Response.Redirect("AdvanceSearchResult.aspx?Name=" + txtproductName + "&Category=" + listcategory + "&price=" + listprice);
        }
        protected void btnClear_OnClick(object sender, EventArgs e)
        {
            txtbxProductName.Text = string.Empty;
            ddlistcategory.ClearSelection();
            ddlistPrice.ClearSelection();
        }
    }
}